#include "battle_bots_plugin.h"
#include "BattleBots.h"

ModuleLinkerSPtr				global_module_linker_ = nullptr;
TankShowDownSPtr				global_tank_show_ = nullptr;

BattleBotsPlugin::BattleBotsPlugin(QObject* parent) : QObject(parent) {

}

BattleBotsPlugin::~BattleBotsPlugin() {

}

void BattleBotsPlugin::InitPlugin(ModuleLinkerSPtr _context_ptr)
{
	if (!global_module_linker_)
		global_module_linker_ = _context_ptr;

	BattleBotsSPtr battle_bots_ptr = std::make_shared<BattleBots>();
	global_module_linker_->SetServicePtrById(BATTLEBOTSSERVICEID, battle_bots_ptr);
}

void BattleBotsPlugin::StartPlugin()
{
	if (!global_module_linker_)
		return;

	global_tank_show_ = Service(ITankShowDown, TANKSHOWSERVICEID, global_module_linker_);

	return;
}